package com.itheima.health.dao;

import com.itheima.health.pojo.OrderSetting;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * @author spt
 * @description 预约设置DAO
 **/
@Mapper
public interface OrderSettingDao {

    /**
     * 查询预约对象
     *
     * @param orderDate 日期
     * @return 返回预约设置对象
     */
    OrderSetting selectByDate(Date orderDate);

    /**
     * 更新预约对象
     *
     * @param id     预约表id
     * @param number 预约数量
     */
    void updateById(@Param("id") Integer id, @Param("number") int number);

    /**
     * 添加预约对象
     *
     * @param orderSetting 预约对象
     */
    void insert(@Param("orderSetting") OrderSetting orderSetting);

    Integer getNumber(Date orderDate);

    Integer getReservation(Date orderDate);

    //根据时间查询预约人数和可预约人数
    Integer selectRes(Date kaishi);

    Integer selectNum(Date kaishi);

    Integer selectGeshu(Date date);

    /**
     * 修改预约对象，或者添加预约对象
     * @param orderDate
     * @param number
     */
    void updateByDate(Date orderDate, int number);

    void insertByDate(Date orderDate,int number,int res);

    void updatereservation(Date orderDate, Integer reservations);

    List<OrderSetting> selectOrderSetting(@Param("start") String start, @Param("end") String end);
}
